package com.changgou.goods.exception;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @ClassName BaseException
 * @Description: TODO
 * @Author 郑乾
 * @Date 2020-08-02
 * @Version V1.0
 **/
//定义全局异常处理
@RestControllerAdvice
public class BaseException {
    public Result error(Exception e){
        e.printStackTrace();
        return new Result(false, StatusCode.ERROR,e.getMessage());
    }
}
